package com.lvyq.myplayer.model.history

import android.os.Parcelable
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import androidx.room.Update
import kotlinx.android.parcel.Parcelize

/**
 * 文件描述：PlayHistory 播放历史
 * 作者：lvyq
 * 创建时间：2025-06-16
 * 修改时间：2025-06-16
 */
@Entity(
    tableName = "play_history",
    indices = [Index(value = ["businessKey", "type"], unique = true)]
)
@Parcelize
data class PlayHistoryEntity (
    @PrimaryKey(autoGenerate = true)
    var id: Int = 0, // 主键，自动生成
    var businessKey:Int, //单曲id，专辑id，歌单id,MV id
    var title:String,
    var singer:String?,
    var bgImg:String,
    var url:String?,
    var lrc:String?,
    var singerId:Int?,
    var publishDate:String?,
    var albumId:String?,
    var albumName:String?,
    var totalDuration:Int?,
    var createTime:Long, //创建时间
    var updateTime:Long, //更新时间
    var playCount:Long,//播放次数
    var type:Int, //1 单曲 2专辑 3歌单 4MV
): Parcelable